package com.ruoyi.picking.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.picking.mapper.ErpMaterialIssueMapper;
import com.ruoyi.picking.domain.ErpMaterialIssue;
import com.ruoyi.picking.service.IErpMaterialIssueService;

/**
 * 生产领料Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-17
 */
@Service
public class ErpMaterialIssueServiceImpl implements IErpMaterialIssueService 
{
    @Autowired
    private ErpMaterialIssueMapper erpMaterialIssueMapper;

    /**
     * 查询生产领料
     * 
     * @param issueId 生产领料主键
     * @return 生产领料
     */
    @Override
    public ErpMaterialIssue selectErpMaterialIssueByIssueId(Long issueId)
    {
        return erpMaterialIssueMapper.selectErpMaterialIssueByIssueId(issueId);
    }

    /**
     * 查询生产领料列表
     * 
     * @param erpMaterialIssue 生产领料
     * @return 生产领料
     */
    @Override
    public List<ErpMaterialIssue> selectErpMaterialIssueList(ErpMaterialIssue erpMaterialIssue)
    {
        return erpMaterialIssueMapper.selectErpMaterialIssueList(erpMaterialIssue);
    }

    /**
     * 新增生产领料
     * 
     * @param erpMaterialIssue 生产领料
     * @return 结果
     */
    @Override
    public int insertErpMaterialIssue(ErpMaterialIssue erpMaterialIssue)
    {
        erpMaterialIssue.setCreateTime(DateUtils.getNowDate());
        return erpMaterialIssueMapper.insertErpMaterialIssue(erpMaterialIssue);
    }

    /**
     * 修改生产领料
     * 
     * @param erpMaterialIssue 生产领料
     * @return 结果
     */
    @Override
    public int updateErpMaterialIssue(ErpMaterialIssue erpMaterialIssue)
    {
        return erpMaterialIssueMapper.updateErpMaterialIssue(erpMaterialIssue);
    }

    /**
     * 批量删除生产领料
     * 
     * @param issueIds 需要删除的生产领料主键
     * @return 结果
     */
    @Override
    public int deleteErpMaterialIssueByIssueIds(Long[] issueIds)
    {
        return erpMaterialIssueMapper.deleteErpMaterialIssueByIssueIds(issueIds);
    }

    /**
     * 删除生产领料信息
     * 
     * @param issueId 生产领料主键
     * @return 结果
     */
    @Override
    public int deleteErpMaterialIssueByIssueId(Long issueId)
    {
        return erpMaterialIssueMapper.deleteErpMaterialIssueByIssueId(issueId);
    }
}
